﻿@model IEnumerable<QizSessionDetail>
@{
    ViewBag.Title = "趋势分析";

    var xv = Model.Select(v => v.QizSession.Timemark).ToList().ConvertAll<string>(v => v.ToString("yyyy-MM-dd HH:mm"));
    var yv = Model.Select(v => v.UserValue).ToList().ConvertAll<double>(v => double.Parse(v));
    Response.Clear();
    var title = ViewBag.ItemTitle;
    Chart chart = new Chart(width: 940, height: 450)
    .AddSeries(name: title, chartType: "Line",
    xValue: xv,
    yValues: yv
    )
    .AddTitle(title + "趋势分析");
    chart.SetYAxis(min: yv.Min(), max: yv.Max());
    chart.Write(format: "Png");

    Response.Flush();
    Response.End();
}